package pl.edu.pw.MidEmu.Sensing.Values;

/**
 * Basic interface that each sensor value have to implement
 * @author Mateusz Starodab
 *
 */
public interface IValue
{
	/**
	 * Defines how to compare values
	 * @param value Value to compare to
	 * @return -1 when value is lesser, 0 when is equal, ane 1 when is greater
	 */
	public int compare(IValue value);

	/**
	 * Decrements value
	 */
	public void decrementValue();

	/**
	 * Gets value unit
	 * @return Value unit
	 */
	public String getUnit();

	/**
	 * Gets value as float number
	 * @return Float number representation
	 */
	public float getValueAsFloat();

	/**
	 * Gets value as string
	 * @return String representation of value
	 */
	public String getValueAsText();

	/**
	 * Increments value
	 */
	public void incrementValue();

	/**
	 * Parses string with value to the IValue format
	 * @param string String with value to parse
	 * @return IValue representation of string
	 */
	public IValue parse(String string);

	/**
	 * Generates random value
	 */
	public void randomValue();

	/**
	 * Generates random value within specified range
	 * @param lo Low range value
	 * @param hi High range value
	 */
	public void randomValue(IValue lo, IValue hi);
	
	/**
	 * Sets value unit
	 * @param unit Unit to be set for value
	 */
	public void setUnit(String unit);
}
